import { defineStore } from 'pinia'
import type { Product } from '../typing/product'
const productStore = defineStore('product', {
    state:()=>{
        return {
            List:[],
            pageSize:10,
            pageNum:1,
            total:0,
           
    }
},
getters:{
    getLists():Array<Product>{
        return this.List
    },
    getPageSize():number{
        return this.pageSize
    },
    getPageNum():number{
        return this.pageNum
    },
    gettotal():number{
        return this.total
    }
    
  
},
actions:{
    setLists(value:Array<Product>|any){
        this.List = value
    },
    setPageSize(value:number){
        this.pageSize = value
    },
    setPageNum(value:number){
        this.pageNum = value
    },
    settotal(value:number){
        this.total = value
    }
   
}
})
export default productStore